import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;


public class ConjecturaCollatz{
	private static HashSet<Long> seqPD;
	private Map<Integer,String> seq;
	private List<Integer> input;
	
	
	public ConjecturaCollatz(List<Integer> input) {
		this.input = input;
	}

	public Map<Integer,String> conjectura() {
		seq = new HashMap<Integer,String>();
		for (int i = 0; i < this.input.size(); i++) {
			Long atual = (long) this.input.get(i);
			while(atual != 1) {
				if(isEven(atual)) {
					atual = atual /2;
				}else{
					atual = (3*atual) +1;
				}
			}
			seq.put(this.input.get(i), "Pertence a Conjectura");
		}
		return seq;
	}
	
	
	private boolean isEven(long number) {
		return number % 2 ==0;
	}
	
	public static void main(String[] args) {
		for (int i = 0; i < args.length; i++) {
			int n = Integer.parseInt(args[i]);
			
			List<Integer> numeros = NumberGenerator.generateNumber(n);
			ConjecturaCollatz conjectura = new ConjecturaCollatz(numeros);
			Long inicio = new GregorianCalendar().getTimeInMillis();
			Map<Integer,String> result = conjectura.conjectura();
			Long fim = new GregorianCalendar().getTimeInMillis();
			System.out.println("1 " + n + " " + (fim - inicio) + " sequencial");
			
			ConjecturaCollatzPD conjecturaPD = new ConjecturaCollatzPD(numeros);
			conjecturaPD.setSeq(seqPD);
			inicio = new GregorianCalendar().getTimeInMillis();
			HashSet<Long> result2 = conjecturaPD.conjectura();
			fim = new GregorianCalendar().getTimeInMillis();
			seqPD.addAll(result2);
			System.out.println("1 " + n + " " + (fim - inicio) + " sequencialPD");
		}
	}
}
